package com.sk.sourcecircle.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.sourcecircle.R;
import com.sk.sourcecircle.entity.RoundFriendBean;

import java.util.List;

/**
 * Created by sk on 2017/12/20.
 */

public class RoundPepAdapter extends BaseQuickAdapter<RoundFriendBean.DataBean,BaseViewHolder> {

    public RoundPepAdapter(int layoutResId, @Nullable List<RoundFriendBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RoundFriendBean.DataBean item) {
        helper.setText(R.id.tv_name,item.getNickname());
        Glide.with(mContext).load(item.getHead_url()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into((ImageView) helper.getView(R.id.head));
    }
}
